function getCookie(data) {
    return data.split("; ").reduce(function(total, item, index) {
        total[item.split("=")[0]] = item.split("=")[1];
        return total;
    }, {})
}